package mo.org.cm309.shoppingcart.service;

import mo.org.cm309.shoppingcart.dao.UserDAO;
import mo.org.cm309.shoppingcart.entity.User;

public class UserService {
	public void add(User user){
		UserDAO.getInstance().insert(user);
	}
	
	public void register(User user){
		add(user);
	}
	
	// To include services for delete and update users -- AZ 2012-10-31
	public void delete(User user){
		UserDAO.getInstance().delete(user);
	}
	
	public void updateProfile(User user){
		UserDAO.getInstance().update(user);
	}
	
	public User getUserById(long id){
		return UserDAO.getInstance().findById(id);
	}
	
	public User gerUserByEmail(String email){
		return UserDAO.getInstance().findByEmail(email);
	}
}
